package com.itic.appbase.framework.plugins.mybatis.dialect.db;

import com.itic.appbase.framework.plugins.mybatis.Page;
import com.itic.appbase.framework.plugins.mybatis.dialect.Dialect;

public class MysqlDialect
        implements Dialect {
    /**
     * mysql的分页语句
     * 
     * @param sql
     * @param page
     * @return String
     */
    @Override
    public String buildPageSql(String sql, Page page) {
        StringBuilder pageSql = new StringBuilder(100);
        String beginrow = String.valueOf(page.getRecordNow());
        pageSql.append(sql);
        pageSql.append(" limit " + beginrow + "," + page.getPageSize());
        return pageSql.toString();
    }
}
